﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.eforceglobal.crux.DTOs.Configuration;

namespace com.eforceglobal.crux.exceptions
{
    public class CruxExceptionManager
    {
        public static CruxDatabaseException CreateNewDatabaseException(string ErrorCode)
        {
            ErrorInformation errorInformation = CruxApplicationErrorManager.GetApplicationError(ErrorCode);
            return new CruxDatabaseException(errorInformation.ErrorDescription, errorInformation.ErrorNameOrCode);
        }

        public static CruxNotificationException CreateNewNotificationException(string ErrorCode)
        {
            ErrorInformation errorInformation = CruxApplicationErrorManager.GetApplicationError(ErrorCode);
            return new CruxNotificationException(errorInformation.ErrorDescription, errorInformation.ErrorNameOrCode);
        }

        
    }
}
